{% extends "base.html" %}
{% load i18n %}
{% load markup %}

{% block page-title %}
  {{ message.title }}
{% endblock %}

{% block sub-navigation %}
  <ul>
	<li><a href="{% url inhouse.views.show_messages %}" style="font-weight: bold;">&laquo; {% trans "Back to messages" %}</a></li>
  </ul>
{% endblock %}

{% block content %}
  <aside id="right">
    Test
  </aside>
  <section id="xxx" style="width: 78%;">
  <div style="border-top: 1px solid #d3d3d3; border-right: 1px solid #d3d3d3; border-left: 1px solid #d3d3d3; padding: 15px;">
    <div style="float:left;">
      <strong>{{ message.sender.id|show_user_link }}</strong> {% trans "to" %} {{ message.recipient }}
    </div>
    <div style="float:right;">
      {{ message.created|timesince }}
    </div>
    <div style="margin-top: 30px;" class="message-text-{{ message.id }}">{{ message.text }}</div>
  </div>
  <div style="border-left: 1px solid #d3d3d3; border-right: 1px solid #d3d3d3; border-bottom: 1px solid #d3d3d3; background-color: #EEEEEC; padding: 5px;">
    <div id="message-actions-{{ message.id }}">
      {% if can_reply %}
        <a id="message-reply-href-{{ message.id }}" href="javascript:inhouse.messages.reply({{ message.id }}, '{{ message.created|date:"Y/m/d H:i:s" }}', '{{ message.sender }}');">{% trans "Reply" %}</a>
      {% endif %}
      {% if not message.is_archived %}
        <a href="{% url inhouse.views.archive_message message.id %}">{% trans "Archive" %}</a>
      {% endif %}
    </div>
    <div id="message-reply-{{ message.id }}" style="display:none;"></div>
  </div>
  </section>
  {% if user %}
  <div style="display:none;">
    <form method="POST" action="" id="message-reply-form">
      {% csrf_token %}
      <div>
        <textarea rows="7" cols="70" name="message"></textarea>
      </div>
      <input type="hidden" name="subject" value="{{ message.title }}" />
      <input type="hidden" name="message_only" value="1" />
      <input type="submit" value="{% trans "Send Message" %}" />
      <input type="button" value="{% trans "Discard" %}" name="discard" />
    </form>
  </div>
  {%endif%}
{% endblock %}
